package com.woniuxy.cloud.carl.marketing.client;


import com.woniuxy.cloud.carl.marketing.client.param.AddCouponParam;
import com.woniuxy.cloud.carl.marketing.client.param.AddUserCouponParam;
import com.woniuxy.cloud.carl.marketing.client.param.UseCouponParam;
import com.woniuxy.cloud.carl.marketing.client.result.CouponDto;
import com.woniuxy.cloud.carl.marketing.infra.model.Coupon;
import com.woniuxy.cloud.carl.marketing.infra.model.Deduction;
import com.woniuxy.cloud.carl.marketing.infra.model.FullDiscountCoupon;
import com.woniuxy.cloud.carl.marketing.infra.model.ServiceCoupon;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 优惠券记录表 前端控制器
 * </p>
 *
 * @author Lucas
 * @since 2023-07-19
 */
@FeignClient(contextId = "couponClient",name = "marketing")
public interface CouponClient {
    @GetMapping("/getCouponByUserId")
    Result<List<CouponDto>> getCouponByUserId(@RequestParam("userId") Long userId);
    @PostMapping("/addUserCoupon")
    Result addUserCoupon(@RequestBody AddUserCouponParam param);
    @GetMapping("/getMyDiscount")
    Result<List<FullDiscountCoupon>> getMyDiscount(@RequestParam("userId")Long userId);
    @GetMapping("/getMyServiceCoupon")
    Result<List<ServiceCoupon>> getMyServiceCoupon(@RequestParam("serviceId")Long serviceId, @RequestParam("userId")Long userId);
    @GetMapping("/getMyCouponBySpuId")
    Result<List<Deduction>> getMyCouponBySpuId(@RequestParam("skuId")Long skuId, @RequestParam("userId")Long userId);
    @PutMapping("/useCoupon")
    Result<Coupon> useCoupon(@RequestBody UseCouponParam param);
}

